<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/


//登录相关路由
$router->group(['namespace' => 'Web\V1'], function() use ($router) {

    $router->post('web/auth', 'AuthController@auth');

    $router->get('web/login', 'AuthController@login');

});

$router->group(['namespace' => 'Web\V1','prefix'=> 'web/v1/admin','middleware'=> 'Auth'], function()use ($router)  {

    $router->get('/index', 'IndexController@index');
    $router->get('/activity/list','ActivityController@list');
    $router->post('/activity/save','ActivityController@save');
    $router->get('/activity/detail/{id}','ActivityController@detail');
    $router->get('/activity/close','ActivityController@activityClose');
    $router->get('/activity/del','ActivityController@activityDel');
    $router->post('/activity/upload','ActivityController@UploadCdnIamge');

    //奖品相关路由
    $router->get('/prizes','PrizeController@prizes');   //获取所有奖品
    $router->post('/prizes','PrizeController@addPrize'); //增加奖品
    $router->get('/prizes/{id}','PrizeController@getPrize'); //获取指定奖品详情
    $router->delete('/prizes/{id}','PrizeController@deletePrize'); //删除指定奖品
    $router->put('/prizes/{id}','PrizeController@updatePrize'); //更新指定奖品

    //赞助商相关路由
    $router->get('/sponsors','SponsorsController@sponsors');   //获取所有赞助商
    $router->post('/sponsors','SponsorsController@addSponsors'); //增加赞助商
    $router->get('/sponsors/{id}','SponsorsController@getSponsors'); //获取赞助商详情
    $router->delete('/sponsors/{id}','SponsorsController@deleteSponsors'); //删除指定赞助商
    $router->put('/sponsors/{id}','SponsorsController@updateSponsors'); //更新赞助商
});





